Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make MPEG file to have a valid header #494

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

majonezz
Copy link

My dirty hack to repair broken header of MPEG files. Now i'm finally able to send files via a messenger like WhatsApp or so and they are playable there.

My dirty hack to repair broken header of MPEG files. Now i'm finally able to send files via a messenger like WhatsApp or so and they are playable there.
@gabeschine
Copy link
Collaborator

Thank you for submitting a work-around. I am not sure if this is the right issue, but it looks like issue #410 is the relevant one in this case?

Do you have a reproduction that we might be able to use to write a test case for this work-around? If not, how are you validating that the work-around does in fact fix the issue in all cases?

@majonezz
Copy link
Author

Hello. Sorry for a late answer. This workaround is close to #410 but not the same case. It's just adding a little bit of silence to beginning of each file which appear to cure a bad header of the file and allow to pass it via internet communicators. Without a patch, file starts with "LAME" header (4C 41 4D 45) which is not a correct header for MPEG file. That's why i.e. WhatsApp don't allow direct drop-in of that kind of file. Valid MPEG header starts with 0xFF. To reproduce the case just drop an exapmle mp3 file to a chat of https://web.whatsapp.com/ before and after applying the patch. This patch is not fixing artifacts that can occur later in the file since i don't have an idea what cause them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants